<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Axios示例</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script src="https://unpkg.com/axios/dist/axios.min.js"> </script>
</head>

<body>
    <div id="app">
        <div>
            名称:{{info.name}}
        </div>
        <div>
            url:{{info.url}}
        </div>
    </div>

    <script>
        var app = new Vue(
            {
                el: "#app",
                // model层数据
                data() {
                    return {
                        info: {
                            name: '123',
                            url: ''
                        }
                    }
                },
                mounted() {
                    axios
                        .get('data.json')
                        .then(response => this.info = response.data)
                }
            }
        )
    </script>
</body>

</html>